package com.ruoyi.business.listener;

import com.ruoyi.workflow.domain.vo.WfDetailVo;
import com.ruoyi.workflow.service.IWfProcessService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;


@Slf4j
@Component
public class FlowTaskListener implements ExecutionListener {
    @Autowired
    private  IWfProcessService processService;
    @Override
    public void notify(DelegateExecution execution) {
       String processInstanceId = execution.getProcessInstanceId();
        String definitionId=execution.getProcessDefinitionId();
        //String deployId=execution.get();
        Map<String, Object> variables=execution.getVariables();
       // processService.selectFormContent(definitionId, deployId, processInstanceId);
       WfDetailVo queryProcessDetail=processService.queryProcessDetail(processInstanceId,null);
//        System.out.println("流程结束，流程实例ID：" + processInstanceId);

    }
}
